
<!DOCTYPE html>
<html>
  <head>
    <title>管廊数据中心后台管理</title>
    
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
    
    
        <link href="/admin/static/bootstrap/bootstrap3/swatch/default/bootstrap.min.css?v=3.3.5" rel="stylesheet">
        
        <link href="/admin/static/bootstrap/bootstrap3/css/bootstrap-theme.min.css?v=3.3.5" rel="stylesheet">
        
        <link href="/admin/static/admin/css/bootstrap3/admin.css?v=1.1.1" rel="stylesheet">
        
        <style>
        body {
            padding-top: 4px;
        }
        </style>
    
    

    
<link rel="stylesheet" type="text/css" href="/marxico.css">

    
    
  </head>
  <body>
    
<div class="container">
  <div class="row">
    <div class="col-md-2">
      <ul class="nav nav-pills nav-stacked">
        
  
        <li class="active">
          <a href="/admin/">首页</a>
        </li>
        <li>
          <a href="/admin/combustibles_history/">combustibles_history</a>
        </li>
        <li>
          <a href="/admin/accesses_history/">accesses_history</a>
        </li>
        <li>
          <a href="/admin/fires_history/">fires_history</a>
        </li>
        <li>
          <a href="/admin/combustibles/">combustibles</a>
        </li>
        <li>
          <a href="/admin/patrols/">patrols</a>
        </li>
        <li>
          <a href="/admin/employees_history/">employees_history</a>
        </li>
        <li>
          <a href="/admin/structures/">structures</a>
        </li>
        <li>
          <a href="/admin/environments/">environments</a>
        </li>
        <li>
          <a href="/admin/employees/">employees</a>
        </li>
        <li>
          <a href="/admin/accesses/">accesses</a>
        </li>
        <li>
          <a href="/admin/equipments/">equipments</a>
        </li>
        <li>
          <a href="/admin/invades_history/">invades_history</a>
        </li>
        <li>
          <a href="/admin/invades/">invades</a>
        </li>
        <li>
          <a href="/admin/videos/">videos</a>
        </li>
        <li>
          <a href="/admin/equipments_history/">equipments_history</a>
        </li>
        <li>
          <a href="/admin/environments_history/">environments_history</a>
        </li>
        <li>
          <a href="/admin/fires/">fires</a>
        </li>
        <li>
          <a href="/admin/structures_history/">structures_history</a>
        </li>

        
  
  

      </ul>
    </div>
    <div class="col-md-10">
      <div id="content">
        
          <h2 id="brand">首页</h2>
          <div class="clearfix"></div>
        
        
  
    
  

        
    
        
    <div id='preview-contents' class='note-content'>





<h1 id="管廊数据中心使用说明">管廊数据中心使用说明</h1>

<div><div class="toc"><div class="toc">
<ul>
<li><a href="#管廊数据中心使用说明">管廊数据中心使用说明</a><ul>
<li><a href="#特性">特性</a></li>
<li><a href="#已接入的数据">已接入的数据</a><ul>
<li><a href="#环境监测系统">环境监测系统</a></li>
<li><a href="#可燃气体泄漏报警系统">可燃气体泄漏报警系统</a></li>
<li><a href="#入侵报警系统">入侵报警系统</a></li>
</ul>
</li>
<li><a href="#数据获取">数据获取</a><ul>
<li><a href="#获取当前所有系统">获取当前所有系统</a></li>
<li><a href="#获取系统内的所有数据">获取系统内的所有数据</a></li>
<li><a href="#获取系统内的指定数据">获取系统内的指定数据</a></li>
<li><a href="#条件筛选参数">条件筛选参数</a></li>
</ul>
</li>
<li><a href="#订阅推送数据">订阅推送数据</a></li>
<li><a href="#后台管理界面">后台管理界面</a></li>
<li><a href="#状态和报警">状态和报警</a></li>
<li><a href="#编号的规则">编号的规则</a><ul>
<li><a href="#系统编号">系统编号</a></li>
<li><a href="#分区编号">分区编号</a></li>
<li><a href="#舱室编号">舱室编号</a></li>
<li><a href="#类型编号">类型编号</a></li>
</ul>
</li>
<li><a href="#系统说明">系统说明</a><ul>
<li><a href="#fires-火灾报警系统">fires- 火灾报警系统</a></li>
<li><a href="#structures-结构监测系统">structures- 结构监测系统</a></li>
<li><a href="#environments-环境监测系统">environments- 环境监测系统</a></li>
<li><a href="#equipments-设备监控系统">equipments- 设备监控系统</a></li>
<li><a href="#invades-入侵报警系统">invades- 入侵报警系统</a></li>
<li><a href="#combustibles-可燃气体泄漏报警系统">combustibles- 可燃气体泄漏报警系统</a></li>
<li><a href="#accesses-出入口控制系统">accesses- 出入口控制系统</a></li>
<li><a href="#employees-出入口控制系统">employees- 出入口控制系统</a></li>
<li><a href="#patrols-电子巡查管理系统">patrols- 电子巡查管理系统</a></li>
<li><a href="#videos-视频监控系统">videos- 视频监控系统</a></li>
</ul>
</li>
<li><a href="#数据模拟">数据模拟</a><ul>
<li><a href="#实时数据模拟">实时数据模拟</a></li>
<li><a href="#报警数据模拟">报警数据模拟</a></li>
<li><a href="#人员定位数据模拟">人员定位数据模拟</a></li>
<li><a href="#门禁系统数据模拟">门禁系统数据模拟</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>



<h2 id="特性">特性</h2>

<ul><li>支持web api进行数据操作</li>
<li>支持对查询数据进行筛选</li>
<li>支持<code>rabbitmq</code>数据推送</li>
<li>支持数据变化自动存储到历史</li>
<li>支持数据的模拟，并且可配置模拟参数</li>
</ul>



<h2 id="已接入的数据">已接入的数据</h2>

<h3 id="环境监测系统">环境监测系统</h3>

<table>
<thead>
<tr>
  <th align="center">设备类型</th>
  <th align="center">设备编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">液位</td>
  <td align="center">L002_101_001_2101</td>
</tr>
<tr>
  <td align="center">温度</td>
  <td align="center">L002_101_001_2201</td>
</tr>
<tr>
  <td align="center">湿度</td>
  <td align="center">L002_101_001_2301</td>
</tr>
<tr>
  <td align="center">氧气</td>
  <td align="center">L002_101_001_2401</td>
</tr>
<tr>
  <td align="center">硫化氢</td>
  <td align="center">L002_101_002_2501</td>
</tr>
</tbody></table>


<h3 id="可燃气体泄漏报警系统">可燃气体泄漏报警系统</h3>

<table>
<thead>
<tr>
  <th align="center">设备类型</th>
  <th align="center">设备编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">可燃气体传感器</td>
  <td align="center">L009_101_002_9101</td>
</tr>
</tbody></table>


<h3 id="入侵报警系统">入侵报警系统</h3>

<table>
<thead>
<tr>
  <th align="center">设备类型</th>
  <th align="center">设备编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">入侵报警探测装置</td>
  <td align="center">L005_101_001_5101</td>
</tr>
<tr>
  <td align="center">入侵报警探测装置</td>
  <td align="center">L005_101_001_5102</td>
</tr>
</tbody></table>


<h2 id="数据获取">数据获取</h2>



<h3 id="获取当前所有系统">获取当前所有系统</h3>

<p><a href="http://118.26.73.70:19090" target="_blank">http://118.26.73.70:19090</a></p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">C:\&gt; curl -i http://<span class="hljs-number">118.26</span><span class="hljs-number">.73</span><span class="hljs-number">.70</span>:<span class="hljs-number">19090</span>
</div><div class="hljs-line">
</div><div class="hljs-line">HTTP/<span class="hljs-number">1.1</span> <span class="hljs-number">200</span> OK
</div><div class="hljs-line">Content-Length →<span class="hljs-number">786</span>
</div><div class="hljs-line">Content-Type →application/json
</div><div class="hljs-line">
</div><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"accesses"</span>: <span class="hljs-string">"/accesses{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"accesses_history"</span>: <span class="hljs-string">"/accesses_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"combustibles"</span>: <span class="hljs-string">"/combustibles{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"combustibles_history"</span>: <span class="hljs-string">"/combustibles_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"employees"</span>: <span class="hljs-string">"/employees{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"employees_history"</span>: <span class="hljs-string">"/employees_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"environments"</span>: <span class="hljs-string">"/environments{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"environments_history"</span>: <span class="hljs-string">"/environments_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"equipments"</span>: <span class="hljs-string">"/equipments{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"equipments_history"</span>: <span class="hljs-string">"/equipments_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"fires"</span>: <span class="hljs-string">"/fires{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"fires_history"</span>: <span class="hljs-string">"/fires_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"invades"</span>: <span class="hljs-string">"/invades{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"invades_history"</span>: <span class="hljs-string">"/invades_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"patrols"</span>: <span class="hljs-string">"/patrols{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"structures"</span>: <span class="hljs-string">"/structures{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"structures_history"</span>: <span class="hljs-string">"/structures_history{/serial}"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"videos"</span>: <span class="hljs-string">"/videos{/serial}"</span>
</div><div class="hljs-line">}
</div></code></pre>



<h3 id="获取系统内的所有数据">获取系统内的所有数据</h3>

<p><a href="http://118.26.73.70:19090/:system/" target="_blank">http://118.26.73.70:19090/:system/</a></p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">C:\&gt; curl -i http://<span class="hljs-number">118.26</span><span class="hljs-number">.73</span><span class="hljs-number">.70</span>:<span class="hljs-number">19090</span>/environments/
</div><div class="hljs-line">
</div><div class="hljs-line">HTTP/<span class="hljs-number">1.1</span> <span class="hljs-number">200</span> OK
</div><div class="hljs-line">Content-Length →<span class="hljs-number">60467</span>
</div><div class="hljs-line">Content-Type →application/json
</div><div class="hljs-line">ETag →<span class="hljs-string">"416de6708af63b2d16648b043ef9eca7"</span>
</div><div class="hljs-line">
</div><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"resources"</span>: [
</div><div class="hljs-line">        {
</div><div class="hljs-line">            <span class="hljs-attr">"alarm"</span>: <span class="hljs-string">"无报警"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"area"</span>: <span class="hljs-string">"起点"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"max_alarm"</span>: <span class="hljs-number">1</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"max_range"</span>: <span class="hljs-number">5</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"min_alarm"</span>: <span class="hljs-number">0</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"min_range"</span>: <span class="hljs-number">0</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"mock"</span>: <span class="hljs-string">"@float(0, 1, 2, 2)"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"module"</span>: <span class="hljs-string">"综合舱1"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"name"</span>: <span class="hljs-string">"液位传感器1号"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_100_001_2101"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"state"</span>: <span class="hljs-string">"正常"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"time"</span>: <span class="hljs-string">"2017-10-24T15:48:56"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"type"</span>: <span class="hljs-string">"液位传感器"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"unit"</span>: <span class="hljs-string">"m"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"value"</span>: <span class="hljs-number">1.11</span>
</div><div class="hljs-line">        },
</div><div class="hljs-line">        {
</div><div class="hljs-line">            <span class="hljs-attr">"alarm"</span>: <span class="hljs-string">"无报警"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"area"</span>: <span class="hljs-string">"起点"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"max_alarm"</span>: <span class="hljs-number">1</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"max_range"</span>: <span class="hljs-number">5</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"min_alarm"</span>: <span class="hljs-number">0</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"min_range"</span>: <span class="hljs-number">0</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"mock"</span>: <span class="hljs-string">"@float(0, 1, 2, 2)"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"module"</span>: <span class="hljs-string">"综合舱2"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"name"</span>: <span class="hljs-string">"液位传感器2号"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_100_002_2101"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"state"</span>: <span class="hljs-string">"正常"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"time"</span>: <span class="hljs-string">"2017-10-24T15:49:26"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"type"</span>: <span class="hljs-string">"液位传感器"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"unit"</span>: <span class="hljs-string">"m"</span>,
</div><div class="hljs-line">            <span class="hljs-attr">"value"</span>: <span class="hljs-number">0.49</span>
</div><div class="hljs-line">        } ...
</div><div class="hljs-line">    ]
</div><div class="hljs-line">}
</div></code></pre>



<h3 id="获取系统内的指定数据">获取系统内的指定数据</h3>

<p><a href="http://118.26.73.70:19090/:system/:serial" target="_blank">http://118.26.73.70:19090/:system/:serial</a></p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">C:\&gt; curl -i http://<span class="hljs-number">118.26</span><span class="hljs-number">.73</span><span class="hljs-number">.70</span>:<span class="hljs-number">19090</span>/environments/L<span class="hljs-number">0</span><span class="hljs-number">0</span><span class="hljs-number">2</span>_<span class="hljs-number">1</span><span class="hljs-number">0</span><span class="hljs-number">0</span>_<span class="hljs-number">0</span><span class="hljs-number">0</span><span class="hljs-number">1</span>_<span class="hljs-number">2</span><span class="hljs-number">1</span><span class="hljs-number">0</span><span class="hljs-number">1</span>
</div><div class="hljs-line">
</div><div class="hljs-line">HTTP/<span class="hljs-number">1.1</span> <span class="hljs-number">200</span> OK
</div><div class="hljs-line">Content-Length →<span class="hljs-number">455</span>
</div><div class="hljs-line">Content-Type →application/json
</div><div class="hljs-line">ETag →<span class="hljs-string">"07d918a13b374dbd68daad9b02305ed5"</span>
</div><div class="hljs-line">Link →&lt;/environments/<span class="hljs-number">1</span>&gt;; rel=self, &lt;/environments/<span class="hljs-number">1</span>&gt;; rel=related
</div><div class="hljs-line">
</div><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"alarm"</span>: <span class="hljs-string">"无报警"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"area"</span>: <span class="hljs-string">"起点"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"max_alarm"</span>: <span class="hljs-number">1</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"max_range"</span>: <span class="hljs-number">5</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"min_alarm"</span>: <span class="hljs-number">0</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"min_range"</span>: <span class="hljs-number">0</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"mock"</span>: <span class="hljs-string">"@float(0, 1, 2, 2)"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"module"</span>: <span class="hljs-string">"综合舱1"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"name"</span>: <span class="hljs-string">"液位传感器1号"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_100_001_2101"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"state"</span>: <span class="hljs-string">"正常"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"time"</span>: <span class="hljs-string">"2017-10-24T15:48:56"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"type"</span>: <span class="hljs-string">"液位传感器"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"unit"</span>: <span class="hljs-string">"m"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"value"</span>: <span class="hljs-number">1.11</span>
</div><div class="hljs-line">}
</div></code></pre>



<h3 id="条件筛选参数">条件筛选参数</h3>

<p><a href="http://118.26.73.70:19090/:system?q=:query" target="_blank">http://118.26.73.70:19090/:system?q=:query</a></p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">C:\&gt; curl http://<span class="hljs-number">118.26</span><span class="hljs-number">.73</span><span class="hljs-number">.70</span>:<span class="hljs-number">19090</span>/environments/?q=
</div><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"filters"</span>: {
</div><div class="hljs-line">      <span class="hljs-attr">"type"</span>: <span class="hljs-string">"温度传感器"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"state"</span>: [<span class="hljs-string">"正常"</span>, <span class="hljs-string">"断线"</span>, <span class="hljs-string">"掉电"</span>],
</div><div class="hljs-line">      <span class="hljs-attr">"time"</span>: [<span class="hljs-string">"2017-10-23"</span>, <span class="hljs-string">"2017-10-25"</span>]
</div><div class="hljs-line">    },
</div><div class="hljs-line">    <span class="hljs-attr">"columns"</span>: [<span class="hljs-string">"name"</span>, <span class="hljs-string">"serial"</span>, <span class="hljs-string">"value"</span>],
</div><div class="hljs-line">    <span class="hljs-attr">"order_by"</span>: <span class="hljs-string">"serial"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"page"</span>: <span class="hljs-number">1</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"page_size"</span>: <span class="hljs-number">5</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"remove_duplicate"</span>: <span class="hljs-string">"alarm"</span>
</div><div class="hljs-line">}
</div><div class="hljs-line">
</div><div class="hljs-line">
</div><div class="hljs-line">{
</div><div class="hljs-line">  <span class="hljs-attr">"total"</span>: <span class="hljs-number">5</span>
</div><div class="hljs-line">  <span class="hljs-string">"resources"</span>: [
</div><div class="hljs-line">    {
</div><div class="hljs-line">      <span class="hljs-attr">"name"</span>: <span class="hljs-string">"温度传感器1号"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_101_001_2201"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"value"</span>: <span class="hljs-number">19.02</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    {
</div><div class="hljs-line">      <span class="hljs-attr">"name"</span>: <span class="hljs-string">"温度传感器2号"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_101_002_2201"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"value"</span>: <span class="hljs-number">28.97</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    {
</div><div class="hljs-line">      <span class="hljs-attr">"name"</span>: <span class="hljs-string">"温度传感器3号"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_101_003_2201"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"value"</span>: <span class="hljs-number">29.48</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    {
</div><div class="hljs-line">      <span class="hljs-attr">"name"</span>: <span class="hljs-string">"温度传感器4号"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_102_001_2201"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"value"</span>: <span class="hljs-number">22.44</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    {
</div><div class="hljs-line">      <span class="hljs-attr">"name"</span>: <span class="hljs-string">"温度传感器5号"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"serial"</span>: <span class="hljs-string">"L002_102_002_2201"</span>,
</div><div class="hljs-line">      <span class="hljs-attr">"value"</span>: <span class="hljs-number">23.25</span>
</div><div class="hljs-line">    }
</div><div class="hljs-line">  ]
</div><div class="hljs-line">}
</div><div class="hljs-line">
</div></code></pre>

<blockquote>
  <p><strong>filters：</strong> 过滤条件，多个条件为<code>and</code>的关系。若条件值为<code>array</code>，则<code>array</code>内的元素为<code>or</code>的关系（若数组内有且只有<strong>2个</strong>元素且类型为<code>int</code>、<code>float</code>、<code>datetime</code>类型则视为<code>between</code>的关系）。  </p>

  <p><strong>columns：</strong> 返回的列， 类型可以为<code>string</code>或<code>array</code>。当为聚合查询时，可以为函数并且结合group_by条件。  </p>

  <p><strong>group_by：</strong> 分组条件， 类型同<code>columns</code>一致。</p>

  <p><strong>order_by：</strong> 指定排序的列， 类型可以为<code>string</code> 或 <code>array</code>，若类型为<code>array</code>，则第二个元素必须是<code>asc</code> 或 <code>desc</code>其中的一个。默认为<code>asc</code>。</p>

  <p><strong>page：</strong> 当前返回的页数。</p>

  <p><strong>page_size：</strong> 返回每页的个数。</p>

  <p><strong>remove_duplicate：</strong> 指定过滤的列，类型为<code>string</code>。过滤相邻记录的重复值</p>

  <p><strong>limit：</strong> 返回数据的条数，类型为<code>int</code>。</p>

  <p><strong>offset：</strong> 指定偏移量，类型为<code>int</code>。</p>

  <p><strong>注意：</strong> page、page_size和limit、offset不能同时使用。 当条件中存在limit或offset时，page、page_size条件失效。page、page_size必须成对出现，而limit和offset可单独使用。</p>

</blockquote>

<h2 id="订阅推送数据">订阅推送数据</h2>

<p>开放的<code>amqp</code>协议端口为 <code>25675</code> <br>
开放的<code>stomp</code>协议端口为 <code>25674</code> <br>
开放的<code>web</code>协议端口为 <code>25672</code> <br>
数据推送采用的是<code>rabbitmq</code>基于<code>amq.topic</code>的<code>exchange</code>。当有数据推送时，topic为系统名称， body为变化的数据。 数据格式参考<code>获取系统内的指定数据</code>。服务器端<code>rabbitmq</code>开启了<code>stomp</code>协议，前端可通过<code>websocket</code>直接订阅。具体示例参考 <a href="http://www.rabbitmq.com/web-stomp.html" target="_blank">官方文档</a></p>



<h2 id="后台管理界面">后台管理界面</h2>

<p>后台管理界面的地址为： <a href="http://118.26.73.70:19090/admin" target="_blank">http://118.26.73.70:19090/admin</a></p>

<p>后台管理提供了对数据的增删改的操作，修改可触发数据推送。</p>



<h2 id="状态和报警">状态和报警</h2>

<p>状态值：<code>正常</code>、<code>断线</code>、<code>掉电</code>、<code>故障</code>、<code>标校</code></p>

<p>报警值： <code>无报警</code>、<code>一般报警</code>、<code>严重报警</code></p>



<h2 id="编号的规则">编号的规则</h2>

<p>编号的规则为<strong>L</strong> + <strong>3位系统编号</strong>+<strong>3位分区编号</strong>+<strong>3位舱室编号</strong>+<strong>4位类型编号</strong>。若不存在舱室，则舱室节段省略</p>

<blockquote>
  <p><strong>提示：</strong> 4位类型编号 = 类型编号 + 当前类型设备个数</p>
</blockquote>



<h3 id="系统编号">系统编号</h3>

<table>
<thead>
<tr>
  <th align="center">系统名称</th>
  <th align="center">系统编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">structures</td>
  <td align="center">1</td>
</tr>
<tr>
  <td align="center">environments</td>
  <td align="center">2</td>
</tr>
<tr>
  <td align="center">equipments</td>
  <td align="center">3</td>
</tr>
<tr>
  <td align="center">videos</td>
  <td align="center">4</td>
</tr>
<tr>
  <td align="center">invades</td>
  <td align="center">5</td>
</tr>
<tr>
  <td align="center">accesses</td>
  <td align="center">6</td>
</tr>
<tr>
  <td align="center">patrols</td>
  <td align="center">7</td>
</tr>
<tr>
  <td align="center">telephones</td>
  <td align="center">8</td>
</tr>
<tr>
  <td align="center">combustibles</td>
  <td align="center">9</td>
</tr>
<tr>
  <td align="center">fires</td>
  <td align="center">10</td>
</tr>
</tbody></table>




<h3 id="分区编号">分区编号</h3>

<table>
<thead>
<tr>
  <th align="center">分区名称</th>
  <th align="center">分区编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">起点</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">101分区</td>
  <td align="center">101</td>
</tr>
<tr>
  <td align="center">102分区</td>
  <td align="center">102</td>
</tr>
<tr>
  <td align="center">103分区</td>
  <td align="center">103</td>
</tr>
<tr>
  <td align="center">104分区</td>
  <td align="center">104</td>
</tr>
<tr>
  <td align="center">105分区</td>
  <td align="center">105</td>
</tr>
<tr>
  <td align="center">106分区</td>
  <td align="center">106</td>
</tr>
<tr>
  <td align="center">107分区</td>
  <td align="center">107</td>
</tr>
</tbody></table>




<h3 id="舱室编号">舱室编号</h3>

<table>
<thead>
<tr>
  <th align="center">分区名称</th>
  <th align="center">分区编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">起点</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">综合舱1</td>
  <td align="center">1</td>
</tr>
<tr>
  <td align="center">综合舱2</td>
  <td align="center">2</td>
</tr>
<tr>
  <td align="center">电力舱</td>
  <td align="center">3</td>
</tr>
<tr>
  <td align="center">供电所</td>
  <td align="center">4</td>
</tr>
<tr>
  <td align="center">设备间</td>
  <td align="center">5</td>
</tr>
</tbody></table>




<h3 id="类型编号">类型编号</h3>

<table>
<thead>
<tr>
  <th align="center">类型名称</th>
  <th align="center">类型编号</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">管廊沉降检测仪</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">管廊扭转检测仪</td>
  <td align="center">200</td>
</tr>
<tr>
  <td align="center">接缝张开检测仪</td>
  <td align="center">300</td>
</tr>
<tr>
  <td align="center">液位传感器</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">温度传感器</td>
  <td align="center">200</td>
</tr>
<tr>
  <td align="center">湿度传感器</td>
  <td align="center">300</td>
</tr>
<tr>
  <td align="center">氧气传感器</td>
  <td align="center">400</td>
</tr>
<tr>
  <td align="center">硫化氢探测器</td>
  <td align="center">500</td>
</tr>
<tr>
  <td align="center">风机</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">照明灯开关</td>
  <td align="center">200</td>
</tr>
<tr>
  <td align="center">排水泵</td>
  <td align="center">300</td>
</tr>
<tr>
  <td align="center">摄像机</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">入侵报警探测装置</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">声光报警器</td>
  <td align="center">200</td>
</tr>
<tr>
  <td align="center">进门读卡器</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">人员定位分站</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">无线基站</td>
  <td align="center">200</td>
</tr>
<tr>
  <td align="center">防爆有线电话</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">可燃气体检测报警器</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">手动报警器</td>
  <td align="center">100</td>
</tr>
<tr>
  <td align="center">智能烟感传感器</td>
  <td align="center">200</td>
</tr>
<tr>
  <td align="center">火灾环境测温感温光缆</td>
  <td align="center">300</td>
</tr>
</tbody></table>




<h2 id="系统说明">系统说明</h2>



<h3 id="fires-火灾报警系统"><code>fires</code>- 火灾报警系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">String</td>
  <td align="center">实时值</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>




<h3 id="structures-结构监测系统"><code>structures</code>- 结构监测系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">unit</td>
  <td align="center">String</td>
  <td align="center">单位</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">max_alarm</td>
  <td align="center">Float</td>
  <td align="center">报警上限阈值</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">Float</td>
  <td align="center">实时值</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>




<h3 id="environments-环境监测系统"><code>environments</code>- 环境监测系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">unit</td>
  <td align="center">String</td>
  <td align="center">单位</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">max_alarm</td>
  <td align="center">Float</td>
  <td align="center">报警上限阈值</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">min_alarm</td>
  <td align="center">Float</td>
  <td align="center">报警下限阈值</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">max_range</td>
  <td align="center">Float</td>
  <td align="center">量程上限</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">min_range</td>
  <td align="center">Float</td>
  <td align="center">量程下限</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">Float</td>
  <td align="center">实时值</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>




<h3 id="equipments-设备监控系统"><code>equipments</code>- 设备监控系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">voltage</td>
  <td align="center">Float</td>
  <td align="center">电压（V）</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">electricity</td>
  <td align="center">Float</td>
  <td align="center">电流（mA）</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">String</td>
  <td align="center">实时值</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>




<h3 id="invades-入侵报警系统"><code>invades</code>- 入侵报警系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">String</td>
  <td align="center">实时值</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>




<h3 id="combustibles-可燃气体泄漏报警系统"><code>combustibles</code>- 可燃气体泄漏报警系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">unit</td>
  <td align="center">String</td>
  <td align="center">单位</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">max_alarm</td>
  <td align="center">Float</td>
  <td align="center">报警上限阈值</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">min_alarm</td>
  <td align="center">Float</td>
  <td align="center">报警下限阈值</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">max_range</td>
  <td align="center">Float</td>
  <td align="center">量程上限</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">min_range</td>
  <td align="center">Float</td>
  <td align="center">量程下限</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">Float</td>
  <td align="center">实时值</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>


<h3 id="accesses-出入口控制系统"><code>accesses</code>- 出入口控制系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">staff_serial</td>
  <td align="center">String</td>
  <td align="center">员工编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">staff_name</td>
  <td align="center">String</td>
  <td align="center">员工姓名</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>




<h3 id="employees-出入口控制系统"><code>employees</code>- 出入口控制系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
  <th align="center">历史</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">员工编号</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">dept</td>
  <td align="center">String</td>
  <td align="center">部门名称</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">员工姓名</td>
  <td align="center">×</td>
</tr>
<tr>
  <td align="center">patrol_id</td>
  <td align="center">Integer</td>
  <td align="center">所在分站id</td>
  <td align="center">√</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
  <td align="center">√</td>
</tr>
</tbody></table>


<blockquote>
  <p><strong>提示：</strong> <code>patrol_id</code>为电子巡查管理系统的自增id</p>
</blockquote>



<h3 id="patrols-电子巡查管理系统"><code>patrols</code>- 电子巡查管理系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">String</td>
  <td align="center">设备类型</td>
</tr>
<tr>
  <td align="center">value</td>
  <td align="center">Integer</td>
  <td align="center">实时值</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
</tr>
<tr>
  <td align="center">alarm</td>
  <td align="center">String</td>
  <td align="center">报警</td>
</tr>
<tr>
  <td align="center">time</td>
  <td align="center">DateTime</td>
  <td align="center">时间</td>
</tr>
</tbody></table>


<blockquote>
  <p><strong>提示：</strong> 电子巡查管理系统的<code>value</code>表示当前分站人数</p>
</blockquote>



<h3 id="videos-视频监控系统"><code>videos</code>- 视频监控系统</h3>

<table>
<thead>
<tr>
  <th align="center">字段</th>
  <th align="center">类型</th>
  <th align="center">说明</th>
</tr>
</thead>
<tbody><tr>
  <td align="center">area</td>
  <td align="center">String</td>
  <td align="center">分区</td>
</tr>
<tr>
  <td align="center">module</td>
  <td align="center">String</td>
  <td align="center">舱室</td>
</tr>
<tr>
  <td align="center">serial</td>
  <td align="center">String</td>
  <td align="center">设备编号</td>
</tr>
<tr>
  <td align="center">name</td>
  <td align="center">String</td>
  <td align="center">设备名称</td>
</tr>
<tr>
  <td align="center">type</td>
  <td align="center">Integer</td>
  <td align="center">设备类型</td>
</tr>
<tr>
  <td align="center">ip</td>
  <td align="center">String</td>
  <td align="center">ip地址</td>
</tr>
<tr>
  <td align="center">port</td>
  <td align="center">Integer</td>
  <td align="center">端口号</td>
</tr>
<tr>
  <td align="center">user</td>
  <td align="center">String</td>
  <td align="center">用户名</td>
</tr>
<tr>
  <td align="center">password</td>
  <td align="center">String</td>
  <td align="center">密码</td>
</tr>
<tr>
  <td align="center">channel</td>
  <td align="center">Integer</td>
  <td align="center">通道</td>
</tr>
<tr>
  <td align="center">code</td>
  <td align="center">String</td>
  <td align="center">设变编码</td>
</tr>
<tr>
  <td align="center">state</td>
  <td align="center">String</td>
  <td align="center">状态</td>
</tr>
</tbody></table>


<blockquote>
  <ol><li rel="1">类型记录了设备的厂商，例如：1-海康，2-大华</li>
  <li rel="1"><code>code</code>表示当不直接连接摄像机前端时所采用的播放编码</li>
  </ol>
</blockquote>



<h2 id="数据模拟">数据模拟</h2>

<p>模拟数据使用了<code>redis</code>数据库。 在<code>db1</code>中的以<code>redbeat:</code>+<code>系统名称</code>的<code>key</code>对应的<code>definition</code>为模拟数据的定义。</p>



<h3 id="实时数据模拟">实时数据模拟</h3>

<p>实时数据模拟仅包含了实时值<code>value</code>和时间<code>time</code>的改变，默认更新间隔为<code>60秒</code>。 <br>
包含的系统有：</p>

<ol><li rel="1">可燃气体数据模拟</li>
<li rel="1">环境监测数据模拟</li>
<li rel="1">设备监测数据模拟</li>
<li rel="1">结构监测数据模拟</li>
<li rel="1">防火系统数据模拟</li>
<li rel="1">入侵系统数据模拟</li>
</ol>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"name"</span> : <span class="hljs-string">":system_name"</span>, // 任务名称：通常是系统名
</div><div class="hljs-line">    <span class="hljs-attr">"task"</span> : <span class="hljs-string">"celery_app.tasks.mock_value"</span>, //任务：任务调用的方法，不可编辑
</div><div class="hljs-line">    <span class="hljs-attr">"enabled"</span> : <span class="hljs-literal">true</span>, //状态：是否开启任务，可编辑 true/false
</div><div class="hljs-line">    <span class="hljs-attr">"schedule"</span>: {
</div><div class="hljs-line">        <span class="hljs-attr">"__type__"</span>: <span class="hljs-string">"interval"</span>, //任务类型
</div><div class="hljs-line">        <span class="hljs-attr">"every"</span>: <span class="hljs-number">60</span>, //任务周期，单位秒
</div><div class="hljs-line">        <span class="hljs-attr">"relative"</span>: <span class="hljs-literal">false</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    <span class="hljs-attr">"args"</span> : [
</div><div class="hljs-line">        <span class="hljs-string">"XXXX"</span>  //对应的系统名称。 不可编辑
</div><div class="hljs-line">    ],
</div><div class="hljs-line">    <span class="hljs-attr">"kwargs"</span> : {
</div><div class="hljs-line">        <span class="hljs-attr">"min_count"</span> : <span class="hljs-number">100</span>,    // 模拟数据的最少数量
</div><div class="hljs-line">        <span class="hljs-attr">"max_count"</span> : <span class="hljs-number">100</span>    // 模拟数据的最少数量
</div><div class="hljs-line">    }
</div><div class="hljs-line">}
</div></code></pre>

<blockquote>
  <p><strong>schedule</strong>中的<code>interval</code>字段都可以变为定时任务，格式如下：</p>
</blockquote>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line"><span class="hljs-string">"schedule"</span>: {
</div><div class="hljs-line">    <span class="hljs-attr">"__type__"</span>: <span class="hljs-string">"crontab"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"minute"</span> : <span class="hljs-string">"60"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"hour"</span> : <span class="hljs-string">"2"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"day_of_week"</span> : <span class="hljs-string">"*"</span>, // 每周的第几天
</div><div class="hljs-line">    <span class="hljs-attr">"day_of_month"</span> : <span class="hljs-string">"*"</span>, // 每月的第几天
</div><div class="hljs-line">    <span class="hljs-attr">"month_of_year"</span> : <span class="hljs-string">"*"</span> // 每年的第几月
</div><div class="hljs-line">}
</div></code></pre>



<h3 id="报警数据模拟">报警数据模拟</h3>

<p>报警数据模拟会以下列表中更新数据库的<code>alarm</code>和<code>time</code>字段,默认的更新间隔为<code>5分钟</code></p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"name"</span> : <span class="hljs-string">"alarm"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"task"</span> : <span class="hljs-string">"celery_app.tasks.mock_alarm"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"enabled"</span> : <span class="hljs-literal">true</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"schedule"</span>: {
</div><div class="hljs-line">        <span class="hljs-attr">"__type__"</span>: <span class="hljs-string">"interval"</span>,
</div><div class="hljs-line">        <span class="hljs-attr">"every"</span>: <span class="hljs-number">300</span>,
</div><div class="hljs-line">        <span class="hljs-attr">"relative"</span>: <span class="hljs-literal">false</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    <span class="hljs-attr">"args"</span> : [ // 表示在下面列表中的系统报警，需要下列表必须有alarm字段
</div><div class="hljs-line">        <span class="hljs-string">"access"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"combustibles"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"environments"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"equipments"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"fires"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"invades"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"structures"</span>
</div><div class="hljs-line">    ],
</div><div class="hljs-line">    <span class="hljs-attr">"kwargs"</span> : {
</div><div class="hljs-line">        <span class="hljs-attr">"min_system"</span> : <span class="hljs-number">1</span>,// 报警系统最少数量， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"max_system"</span> : <span class="hljs-number">2</span>,// 报警系统最多数量， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"sys_min_count"</span> : <span class="hljs-number">2</span>, // 单个系统报警最少数量， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"sys_max_count"</span> : <span class="hljs-number">2</span>, // 单个系统报警最大数量， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"alarm_desc"</span> : [ // 报警字段的值在下面列表中选择， 可编辑
</div><div class="hljs-line">            <span class="hljs-string">"一般报警"</span>,
</div><div class="hljs-line">            <span class="hljs-string">"严重报警"</span>
</div><div class="hljs-line">        ],
</div><div class="hljs-line">        <span class="hljs-attr">"normal_desc"</span> : <span class="hljs-string">"无报警"</span>, // 消警是报警字段的值， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"during_min"</span> : <span class="hljs-number">30</span>, // 报警持续的最少时间， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"during_max"</span> : <span class="hljs-number">120</span> // 报警持续的最大时间， 可编辑
</div><div class="hljs-line">    }
</div><div class="hljs-line">}
</div></code></pre>



<h3 id="人员定位数据模拟">人员定位数据模拟</h3>

<p>人员定位数据模拟会更新<code>emp</code>表中的<code>patrol_id</code>字段以及<code>patrols</code>表中的<code>value</code>字段，默认更新时间为<code>3分钟</code>。</p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"name"</span> : <span class="hljs-string">"employees"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"task"</span> : <span class="hljs-string">"celery_app.tasks.mock_alarm"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"enabled"</span> : <span class="hljs-literal">true</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"schedule"</span>: {
</div><div class="hljs-line">        <span class="hljs-attr">"__type__"</span>: <span class="hljs-string">"interval"</span>,
</div><div class="hljs-line">        <span class="hljs-attr">"every"</span>: <span class="hljs-number">180</span>,
</div><div class="hljs-line">        <span class="hljs-attr">"relative"</span>: <span class="hljs-literal">false</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    <span class="hljs-attr">"args"</span> : [ // 人员将在编号为以下列表中的分站往返行走， 可编辑
</div><div class="hljs-line">        <span class="hljs-string">"L007_101_001_7101"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_101_001_7102"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_102_001_7101"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_102_001_7102"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_103_001_7101"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_103_001_7102"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_104_001_7101"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_104_001_7102"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_105_001_7101"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_105_001_7102"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_106_001_7101"</span>,
</div><div class="hljs-line">        <span class="hljs-string">"L007_106_001_7102"</span>
</div><div class="hljs-line">    ],
</div><div class="hljs-line">    <span class="hljs-attr">"kwargs"</span> : {
</div><div class="hljs-line">        <span class="hljs-attr">"min_count"</span> : <span class="hljs-number">1</span>, // 人数最少数量， 可编辑
</div><div class="hljs-line">        <span class="hljs-attr">"max_count"</span> : <span class="hljs-number">5</span> // 人数最多数量， 可编辑
</div><div class="hljs-line">    }
</div><div class="hljs-line">}
</div></code></pre>



<h3 id="门禁系统数据模拟">门禁系统数据模拟</h3>

<p>门禁系统数据模拟会更新<code>accesses</code>表中的<code>staff_serial</code>和<code>staff_name</code>字段,默认更新间隔为<code>60秒</code></p>



<pre class="prettyprint hljs-dark"><code class="language-json hljs"><div class="hljs-line">{
</div><div class="hljs-line">    <span class="hljs-attr">"name"</span> : <span class="hljs-string">"access"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"task"</span> : <span class="hljs-string">"celery_app.tasks.mock_access"</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"enabled"</span> : <span class="hljs-literal">true</span>,
</div><div class="hljs-line">    <span class="hljs-attr">"schedule"</span>: {
</div><div class="hljs-line">        <span class="hljs-attr">"__type__"</span>: <span class="hljs-string">"interval"</span>,
</div><div class="hljs-line">        <span class="hljs-attr">"every"</span>: <span class="hljs-number">60</span>,
</div><div class="hljs-line">        <span class="hljs-attr">"relative"</span>: <span class="hljs-literal">false</span>
</div><div class="hljs-line">    },
</div><div class="hljs-line">    <span class="hljs-attr">"args"</span> : [],
</div><div class="hljs-line">    <span class="hljs-attr">"kwargs"</span> : {}
</div><div class="hljs-line">}
</div></code></pre></div>

      </div>
    </div>
  </div>
</div>


    
    <script src="/admin/static/vendor/jquery.min.js?v=2.1.4" type="text/javascript"></script>
    <script src="/admin/static/bootstrap/bootstrap3/js/bootstrap.min.js?v=3.3.5" type="text/javascript"></script>
    <script src="/admin/static/vendor/moment.min.js?v=2.9.0" type="text/javascript"></script>
    <script src="/admin/static/vendor/select2/select2.min.js?v=3.5.2" type="text/javascript"></script>
    
    

    
    
  </body>
</html>